import request from "@/utils/request";

export function getAll() {
  return request({
    url: "/admin/article/all",
    method: "post"
  });
}

export function getList(data) {
  return request({
    url: "/admin/article/list",
    method: "post",
    data
  });
}

export function create(data) {
  return request({
    url: "/admin/article/create",
    method: "post",
    data
  });
}

export function edit(data) {
  return request({
    url: "/admin/article/edit",
    method: "post",
    data
  });
}

export function del(data) {
  return request({
    url: "/admin/article/del",
    method: "post",
    data
  });
}

export function getDetail(data) {
  return request({
    url: "/admin/article/detail",
    method: "post",
    data
  });
}

// export function fetchList(query) {
//   return request({
//     url: '/vue-element-admin/article/list',
//     method: 'get',
//     params: query
//   })
// }

// export function fetchArticle(id) {
//   return request({
//     url: '/vue-element-admin/article/detail',
//     method: 'get',
//     params: { id }
//   })
// }

// export function fetchPv(pv) {
//   return request({
//     url: '/vue-element-admin/article/pv',
//     method: 'get',
//     params: { pv }
//   })
// }

// export function createArticle(data) {
//   return request({
//     url: '/vue-element-admin/article/create',
//     method: 'post',
//     data
//   })
// }

// export function updateArticle(data) {
//   return request({
//     url: '/vue-element-admin/article/update',
//     method: 'post',
//     data
//   })
// }
